REBOL []
do %libs.r

either system/script/args [
    set-modes system/ports/input [binary: true]
    data: as-string copy system/ports/input
    make-dir %test/
    write %test/bean.xml data
] [
    data: read %test/bean.xml
]

;?? data

keep-data: copy data ; useable as reply for debugging, if selfmade stuff breaks

blk: load-xml data



blk: beans-to-rebol probe top-array blk
?? blk


[
]

???
res: [
 "tricky chars (<>&`^^)"
 some words
 1 2.2 3x4
 [subblock]
 :w 
 w: 'w
 #issue
 http://url
 %file
 <tag>
 e@mail
 #[none]
 #"d"
 true false
 (paren)
 a/path
 a/set-path:
 'a/lit-path
 8-May-2007/9:29:40.5261000022+2:00 
 0:0:4
 1.2.3.4
]

xres: to-bean-result probe rebol-to-beans res

xres: wrap-xml probe mold-xml-body probe xres

print "- compressions"
probe length? xres
probe length? compress xres
probe length? mold res
probe length? compress mold res
write %test/result.xml xres



print "-bean-result-"
print xres
;prin keep-data


either system/script/args [
] [
    print now wait 4 quit
]
